package edums.common.model.service;

import java.sql.SQLException;

import edums.common.dto.UsersDTO;
import edums.common.model.dao.UsersDAO;

public class UsersServiceImpl implements UsersService {
	
	public UsersDAO usersDAO;
	
	public void setUsersDAO(UsersDAO usersDAO) {
		this.usersDAO = usersDAO;
	}

	@Override
	public UsersDTO doGetUserInfo(UsersDTO usersDTO) throws SQLException{
		return usersDAO.selectUserInfo(usersDTO);
	}
	
	@Override
	public int doGetUsersCount(String userId) throws SQLException {
		return usersDAO.selectUserCountById(userId);
	}
	
	@Override
	public int doUpdateUsers(UsersDTO usersDTO) throws SQLException {
		return usersDAO.updatePassword(usersDTO);
	}
	
	@Override
	public String doGetUserByPassword(String userId) throws SQLException {
		return usersDAO.selectUserByPassword(userId);
	}
}
